isbn=input()
k=1
sum=0
for ch in isbn:
    if ch=='-':
        continue
    else:
        sum=sum+(ord(ch)-48)*k
        sum%=11
        k+=1
        if k>9:
            break

if sum==10 and isbn[-1]=='X':
    print("Right")
elif chr(sum+48)==isbn[-1]:
    print("Right")
else:
    print(isbn[0:-1],end="")
    if sum==10:
        print("X")
    else:
        print(chr(48+sum))
